Ext.define('rangoaqui.utility.Android', {
statics: {
        goBack: function(){
            if (location.hash.length != 0){
                var hash = location.hash.substring(1);
	            Ext.Viewport.setActiveItem(Ext.getCmp(hash));
            } else {
                rangoaqui.utility.addHashToUrl();                                      
            }
        },
        addHashToUrl: function(){
            var id = Ext.Viewport.getActiveItem().id;
            var loc = location.href;
            var hash = location.hash.substring(1);
            var root = null;
 
            if (loc.indexOf('#') != -1){
                root = loc.split('#');
                location.href = root[0] + '#' + id;
            } else if (id != hash){
                location.href = loc + '#' + id;
            }
        }
    }
});